/**
 * 
 */
package com.gi.profiler.model;

import java.sql.Timestamp;
import java.util.ArrayList;

import com.j256.ormlite.field.DataType;
import com.j256.ormlite.field.DatabaseField;

/**
 * @author Ruba
 * 
 */
public class SpotProfileTime {

    @DatabaseField(generatedId = true)
    private int id;

    @DatabaseField(foreign = true)
    private Profile profile;

    @DatabaseField(foreign = true)
    private Spot spot;

    @DatabaseField
    private Timestamp from;

    @DatabaseField
    private Timestamp to;

    @DatabaseField
    private boolean enabled = true;

    @DatabaseField(dataType = DataType.SERIALIZABLE)
    private ArrayList<DayEnum> days;

    public SpotProfileTime() {
    }

    public SpotProfileTime(Profile profile, Spot spot, ArrayList<DayEnum> days) {
	super();
	this.profile = profile;
	this.spot = spot;
	this.days = days;
    }
    
    @Override
    public String toString(){
	String str = "";
		for(DayEnum day:days)
		    str += day.name();
		return str;
	
    }

    /**
     * @return the id
     */
    public int getId() {
	return id;
    }

    /**
     * @return the profile
     */
    public Profile getProfile() {
	return profile;
    }

    /**
     * @return the spot
     */
    public Spot getSpot() {
	return spot;
    }

    /**
     * @return the from
     */
    public Timestamp getFrom() {
	return from;
    }

    /**
     * @return the to
     */
    public Timestamp getTo() {
	return to;
    }

    /**
     * @return the enabled
     */
    public boolean isEnabled() {
	return enabled;
    }

    /**
     * @param id
     *            the id to set
     */
    public void setId(int id) {
	this.id = id;
    }

    /**
     * @param profile
     *            the profile to set
     */
    public void setProfile(Profile profile) {
	this.profile = profile;
    }

    /**
     * @param spot
     *            the spot to set
     */
    public void setSpot(Spot spot) {
	this.spot = spot;
    }

    /**
     * @param from
     *            the from to set
     */
    public void setFrom(Timestamp from) {
	this.from = from;
    }

    /**
     * @param to
     *            the to to set
     */
    public void setTo(Timestamp to) {
	this.to = to;
    }

    /**
     * @param enabled
     *            the enabled to set
     */
    public void setEnabled(boolean enabled) {
	this.enabled = enabled;
    }

    /**
     * @return the days
     */
    public ArrayList<DayEnum> getDays() {
	return days;
    }

    /**
     * @param days
     *            the days to set
     */
    public void setDays(ArrayList<DayEnum> days) {
	this.days = days;
    }

}
